home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / mxcode / sbdsp103 / sbdsp103.doc < prev    next >
Text File  |  1994-09-23  |  6KB  |  120 lines

  1.             _____    ______       ______      _____     ______
  2.            /  _  \  |   __ \     |   __ \    /  _  \   |   __ \
  3.           |  / \__|  | |  \ |     | |  \ |  |  / \__|   | |  | |
  4.           |  \___    | |__/ |     | |  | |  |  \___     | |__| |
  5.            \___  \   |  __ <      | |  | |   \___  \    |  ___/
  6.            __  \  |  | |  \ |     | |  | |   __  \  |   |  |
  7.           |  \_/  |  | |__/ |     | |__/ |  |  \ /  |   |  |
  8.            \_____/  |______/     |______/    \_____/   |____|
  9.                           Version 1.03 (9/23/94)
  10.                          Written by Ethan Brodsky
  11.           Copyright 1994 by Ethan Brodsky.  All rights reserved.
  12.  
  13. This library is distributed AS IS.  The author specifically disclaims
  14. any responsibility for any loss of profit or any consequential,
  15. incidental, or other damages.  SBDSP is freeware and is distributed
  16. with full Turbo Pascal source code.  You are free to incorporate parts
  17. of the code into your own programs as long as you give credit to Ethan
  18. Brodsky.  This source code may only be distributed in it's original
  19. form, including this documentation file.
  20.  
  21. ------------------------------------------------------------------------
  22.  
  23.     You may have used my SBVox and SBVoice units.  They played VOC files
  24. on a Sound Blaster using Creative Labs' CT-VOICE driver.  Since they
  25. used the CT-VOICE driver, they wouldn't work on other sound cards.  The
  26. driver needed to be included with the program, either in a separate file
  27. or linked into the executable.
  28.  
  29.     SBDSP performs the same functions as the SBVox unit without using
  30. the CT-VOICE driver.  It has only been tested on a SB16 and PAS16, but
  31. it should work on all Sound Blaster compatible sound cards.  By using
  32. DMA transfers, it plays sound without using the CPU, saving processor
  33. cycles for your program.
  34.  
  35.     I have many improvements planned, including 16-bit sound, stereo
  36. effects, and mixing, along with new library for FM music.  But I NEED
  37. FEEDBACK!  If you use my code, tell me about it!  If you make any
  38. modifications, send them to me!  If you have any suggestions for
  39. improvements, tell me about them!  If you want me to write a C version,
  40. or a version to play WAV files, tell me!
  41.  
  42.    You don't need to pay me for using this unit.  All you have to do
  43. is put my name in the credits for your product.  I'd appreciate it if
  44. you'd send me a message telling me how you used SBDSP.  (If you used
  45. it in a game, tell me where I can get it)  And finally, if you ever
  46. have a sound programming job, think of me.
  47.  
  48.     You can find out most of the things you need to know in order to
  49. use this library by looking at the PlayVOC example program, but I'll
  50. go over it again.  The first thing you need to do is to reset the DSP,
  51. initialize SBDSP's internal variables, and install the interrupt
  52. handler.  In order to do this, you need to know the sound cards base
  53. address, IRQ number, and 8-bit DMA channel.   If this is being used
  54. on a Sound Blaster, this information can be obtained from the BLASTER
  55. environment variable.  I don't know whether other cards use this.  You
  56. can use the EnvironmentSet function to find out if the environment
  57. variable is set.  If it is, you can call the function InitSBFromEnv.
  58. Otherwise, you'll have to find out the settings some other way and pass
  59. them to the InitSB function.
  60.  
  61.     Use the LoadVOCFile function to allocate a sound buffer.  Make sure
  62. that you save the value returned from this function.  It is the size of
  63. the allocated buffer.  It will be needed when you deallocate the buffer.
  64. The memory needed for Sound will be allocated inside this function. You
  65. do NOT need to allocate it beforehand.
  66.  
  67.     Before you can play any sounds, you have to turn on the speaker
  68. output.  Do this by calling TurnSpeakerOn.  Make sure you turn it off
  69. at the end of the program.  If you want to install a marker handler,
  70. make sure you do it now by calling SetMarkerProc.  A marker handler
  71. will be called each time a marker block is reached.  Before you install
  72. your marker handler, save the old one using GetMarkerProc.  If the value
  73. returned is not nil, then another marker procedure has been installed.
  74. Call it each time your marker procedure is called.  This is a good
  75. practice to get into when setting up a handler such as this.  It will
  76. make it possible to install more than one marker procedure.
  77.  
  78.     To play a sound, pass a pointer to the sound buffer to PlaySound.
  79. Any sound output in progress will be stopped.  To find out if the sound
  80. is finished, check the SoundPlaying variable.  The VOC file format has
  81. a provision for repeating sounds.  The sound can be set to repeat for
  82. a number of times (Or forever)  You can break out of the loop by calling
  83. BreakLoop.  The current iteration will finish and it will continue to
  84. the next block.  When the program is completely finished playing sound,
  85. call the ShutDownSB procedure.  This will stop any sound output in
  86. progress and remove the interrupt handler.  You should deallocate all
  87. sound buffers by using FreeBuffer.  The pointer to the buffer should be
  88. typecasted as a pointer.  Make sure that you pass the buffer size that
  89. was returned by LoadVOCFile so that the right amount of memory is
  90. deallocated.
  91.  
  92.     This library will not allow you to play 16 bit or stereo VOC files.
  93. It will not work in protected mode since it uses DMA transfers.  If you
  94. have any other questions, feel free to ask.  If you would like me to
  95. make any modifications or a customized version of this unit to use in
  96. your program, contact me and we can work out some arrangements.
  97.  
  98. There are several ways to contact me:
  99.     E-Mail:  ericbrodsky@psl.wisc.edu    (Preferred)
  100.     Phone:   (608) 238-4830
  101.     Mail:
  102.         Ethan Brodsky
  103.       4010 Cherokee Dr.
  104.       Madison, WI 53711
  105.  
  106. Bug fixes and other announcements will be posted in:
  107.     comp.lang.pascal
  108.     comp.sys.ibm.pc.soundcard
  109.     comp.sys.ibm.pc.soundcard.tech
  110.     rec.games.programmer
  111.  
  112. Revision history:
  113.     1.00 - First release
  114.     1.01 - Fixed bug that caused problems with sound cards with an IRQ
  115.            settings 8-15.
  116.     1.02 - Fixed bug that caused problems initializing sound card from
  117.            the BLASTER environment variable.  Improved documentation.
  118.     1.03 - Fixed a bug that caused problems initializing sound card from
  119.            the environment.  The GetSettings function has an uninitialized
  120.            return value.